#!/bin/bash

function xf86-input-cmt {
tar xf ../staff/xf86-input-cmt.tar.xz && cd xf86-input-cmt 
bash autogen.sh
./configure --prefix=/usr
make
make install
cd ../
}
function libevdev {
tar xf ../staff/libevdev.tar.xz  && cd libevdev
make
make install
cd ..
}
function gestures {
tar -xf  ../staff/gestures.tar.xz && cd gestures
make
make install
cd ..
}

[[ $EUID -ne 0 ]]  && echo "need root to run" && exit;

libevdev
gestures
xf86-input-cmt 

CONF=(20-mouse.conf  40-touchpad-cmt.conf  50-touchpad-cmt-eve.conf)
[[ ! -d /etc/gesture ]] && mkdir /etc/gesture
for i in ${CONF[@]};
do
	cp $i /etc/gesture
	ln -vs /etc/gesture/$i /usr/share/X11/xorg.conf.d/$i

done

